using System.Globalization;
using Microsoft.AspNetCore.Localization;

var builder = WebApplication.CreateBuilder(args);

var supportedCultures = new[]
{
	new CultureInfo("en"),
	new CultureInfo("zh"),
};

builder.Services.AddControllers();
builder.Services.AddLocalization(
    options => options.ResourcesPath = "Resources"
);
builder.Services.Configure<RequestLocalizationOptions>(options =>
{
   
    options.DefaultRequestCulture = new RequestCulture("en");
    options.SupportedCultures = supportedCultures;
    options.SupportedUICultures = supportedCultures;
});
var app = builder.Build();
app.UseRequestLocalization();
app.UseHttpsRedirection();
app.MapControllers();
app.Run();
